package com.lefeng.cockpit.common.enums;

public enum DataSourceStatusEnum {

    /**
     * 正常
     */
    NORMAL(1, "正常"),

    DISABLE(2, "禁用"),

    DELETE(3, "删除");

    DataSourceStatusEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private int code;

    private String desc;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DataSourceStatusEnum valueOf(Integer code) {
        if (code == null) {
            return null;
        }
        for (DataSourceStatusEnum state : DataSourceStatusEnum.values()) {
            if (state.getCode() == code) {
                return state;
            }
        }

        return null;
    }
}